home *** CD-ROM | disk | FTP | other *** search
- ' an example of custom exception class
-
- ' By convention, the name of all classes that inherit
- ' from System.Exception must end with "Exception"
-
- Class UnableToLoadIniFileException
- Inherits System.ApplicationException
-
- Overrides ReadOnly Property Message() As String
- Get
- Return "Unable to load initialization file"
- End Get
- End Property
- End Class
-
- ' an modified version that also supports inner exceptions
-
- Class InitializationFailedException
- Inherits System.ApplicationException
-
- ' we need this to support parameterless constructor
- Sub New()
- '
- End Sub
-
- ' Custom constructor method
- Sub New(ByVal inner As System.Exception)
- MyBase.New("Unable to load initialization file", inner)
- End Sub
-
- ' note that we don't need to override the Message property in this new version
- ' because it is initialized in the base class constructor
- End Class
-
-